Određivanje uopštene kompleksne funkcije
clear variables
syms w C L R
assume(0 < R & 0 < C & 0 < L )
 
zamena = L == C*R^2
zamena = 
 
vrednosti = [C == 1, R == 1]
vrednosti = 
 
syms s H(s)
H(s) = simplify(subs(R/(R + 1/(1/(s*L) + s*C) + R), lhs(zamena), rhs(zamena)))
H(s) = 
Amplitudska i fazna karakteristika
syms Hjw(w)
Hjw(w) = simplify(subs(H(s), s, 1i*w))
Hjw(w) = 
syms Aw(w)
assume(0 < w)
Aw(w) = simplify(abs(Hjw(w)))
Aw(w) = 
syms phi(w)
phi(w) = angle(Hjw(w))
phi(w) = 
Crtanje amplitudske i fazne karakteristike
figure
 
yyaxis left
fplot(w, subs(Aw(w), lhs(vrednosti), rhs(vrednosti)), [0,4])
ylabel('A(w)')
 
yyaxis right
fplot(w, subs(phi(w), lhs(vrednosti), rhs(vrednosti)), [0,4])
ylabel('\phi(w) [rad]')
xlabel('w')
grid on
Određivanje propusnog opsega
syms Aw_num(w)
Aref = Aw(0)
Aref = 
assume(w>0)
w3dB = expand(solve(Aw(w) == Aref/sqrt(2), w))
w3dB = 
 
Aw_num(w) = subs(Aw, lhs(vrednosti), rhs(vrednosti))
Aw_num(w) = 
 
 
wg1 = subs(w3dB(1), lhs(vrednosti), rhs(vrednosti))
wg1 = 
wg2 = subs(w3dB(2), lhs(vrednosti), rhs(vrednosti))
wg2 = 
Označavanje propusnog opsega u grafiku
figure
fplot(w, subs(Aw(w), lhs(vrednosti), rhs(vrednosti)), [0,4])
hold on
rectangle('Position',[0, 0, double(wg1), double(Aref/sqrt(2))],...
'EdgeColor','r',...
'FaceColor',[1 0.9 0.9],...
'LineWidth',1)
rectangle('Position',[double(wg2), 0, double(4-wg2), double(Aref/sqrt(2))],...
'EdgeColor','r',...
'FaceColor',[1 0.9 0.9],...
'LineWidth',1)
hold off
ylabel('A(w)')
xlabel('w')
grid on